package Oop.ooptest.test02;

public class Mobilphone {
    //定义成员属性，颜色
    String color;
    float price = 1.1f;
    String brand = "华为";

    //定义方法打电话
    public void call(String number) {
        System.out.println("给" + number + "打电话");

    }

    public void playGame() {
        color = "黄色";
        //在使用变量的时候会遵循一个原则，叫做就近原则
        System.out.println("品牌" + brand + "颜色" + color + "价格" + price + "打游戏");
    }
    //定义带有返回值
    public int getJf(){
        System.out.println("打游戏，赚积分");
        return 10;
    }
}
